Skip to content

Ported torchvision detection tutorial into sphinx gallery format #2540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 14, 2023

Conversation

vfdev-5
Copy link
Contributor

@vfdev-5 vfdev-5 commented Sep 1, 2023

Description

  • Ported torchvision detection tutorial into sphinx gallery format

Checklist

  • The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER")
  • Only one issue is addressed in this pull request
  • Labels from the issue that this PR is fixing are added to this pull request
  • No unnecessary issues are included into this pull request.

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 1, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/2540

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 42fcc35 with merge base fca99dd (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@vfdev-5 vfdev-5 marked this pull request as draft September 4, 2023 08:47
@NicolasHug
Copy link
Member

Thanks for the PR @vfdev-5

Looks like the build is failing:

2023-09-04T07:57:27.4350052Z /var/lib/jenkins/workspace/intermediate_source/torchvision_tutorial.py failed leaving traceback:
2023-09-04T07:57:27.4350466Z Traceback (most recent call last):
2023-09-04T07:57:27.4350897Z   File "/var/lib/jenkins/workspace/intermediate_source/torchvision_tutorial.py", line 116, in <module>
2023-09-04T07:57:27.4351304Z     from torchvision import tv_tensors as dp
2023-09-04T07:57:27.4352139Z ImportError: cannot import name 'tv_tensors' from 'torchvision' (/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torchvision/__init__.py)

Because torchvision-0.15.2 got installed instead of the nightly.

I'm not sure we'll be able to merge this PR before 0.16 is actually release :/

In the meantime, I guess we can go ahead and stick to updating the ipynb notebook for collab (as discussed offline)?

@vfdev-5
Copy link
Contributor Author

vfdev-5 commented Sep 4, 2023

@NicolasHug I can temporarily install torchvision nightly for this tutorial and remove it in the end (inside torchvision_tutorial.py). Also, people are doing this :

torchmultimodal-nightly # needs to be updated to stable as soon as it's avaialable

what would you suggest?

@NicolasHug
Copy link
Member

I would avoid that. I'm not sure the maintainers of this repo woudl be too happy with potential breakage coming from torchvision nightly.

The situation isn't really comparable to torchmultimodal: for torchMM, there is no stable package yet, the only thing that is available is the "nightly" package.

Let's just update the ipynb notebook please.

@vfdev-5 vfdev-5 marked this pull request as ready for review October 12, 2023 08:33
@vfdev-5 vfdev-5 requested review from NicolasHug and svekars October 12, 2023 08:33
Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @vfdev-5 , the tutorial and rendered docs all look good as far as I'm concerned, with some easily-addressed points:

  • some images do not render properly (like the one below, but there are others)
    image

  • we write torchvision.TVTensor in some places and that doesn't really exist. Maybe we should be using ~ everywhere in order for the links to look shorter, e.g. :class:`~torchvision.tv_tensors.TVTensor` or :class:`~torchvision.tv_tensors.BoundingBoxes`

I'll let @svekars chime in regarding the changes to the CI etc.

@vfdev-5 vfdev-5 marked this pull request as draft October 12, 2023 10:57
@vfdev-5 vfdev-5 force-pushed the sphinx-tv-tutorial branch from 0e42691 to a2b39cb Compare October 12, 2023 11:47
@vfdev-5 vfdev-5 marked this pull request as ready for review October 12, 2023 12:25
@vfdev-5 vfdev-5 force-pushed the sphinx-tv-tutorial branch from 092909a to 069e507 Compare October 12, 2023 12:58
@vfdev-5
Copy link
Contributor Author

vfdev-5 commented Oct 12, 2023

https://docs-preview.pytorch.org/pytorch/tutorials/2540/intermediate/torchvision_tutorial.html#wrapping-up

Total running time of the script: ( 2 minutes 29.094 seconds)

Additional CI time to build this tutorial

@vfdev-5
Copy link
Contributor Author

vfdev-5 commented Oct 13, 2023

@svekars can you please review this PR regarding CI changes, thanks!

Copy link
Contributor

@svekars svekars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for doing this.

@NicolasHug NicolasHug merged commit 35e2cb0 into pytorch:main Dec 14, 2023
@vfdev-5 vfdev-5 deleted the sphinx-tv-tutorial branch December 14, 2023 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants